package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.math3.linear.RRQRDecomposition;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @AuthOr: Anna Zhang
 * @Date:2024/8/22-17:31
 * @ClassName:com.heima.wemedia.controller.v1
 * @Description:
 **/
@RestController
@RequiredArgsConstructor
public class WeSensitiveQuery {

    private final WmSensitiveService wmSensitiveService;
    @PostMapping("/all")
    public List<String> selectAll(@RequestBody SensitiveDto dto){
        List<WmSensitive> list = wmSensitiveService.list();
        List<String> sensitive = list.stream().map(WmSensitive::getSensitives).collect(Collectors.toList());
        return sensitive;
    }
}
